package com.sam.im.heiqun.utils;

import android.app.Activity;
import android.util.DisplayMetrics;

/**
 * Created by Administrator on 2017/5/12.
 * 常用工具类
 */
public class ContentUtils {
    static DisplayMetrics metrics = new DisplayMetrics();
    //获取屏幕高度
    public static int getScreenHeight(Activity activity){
        activity.getWindowManager().getDefaultDisplay().getMetrics(metrics);
        return metrics.heightPixels;
    }
    //获取屏幕宽度
    public static int getScreenWidth(Activity activity){
        activity.getWindowManager().getDefaultDisplay().getMetrics(metrics);
        return metrics.widthPixels;
    }
}
